<%--
    Document   : registro
    Created on : 6/04/2013, 10:46:15 PM
    Author     : ceci torres
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <%@ page import="java.io.*,java.util.*,java.net.*,java.sql.*" %>
    <%@ page import = "model.conexion" %>
    <%! conexion con = new conexion();%>
    <body>
        <%
            String realname = request.getParameter("realname");
            String gender = request.getParameter("gender");
            String email = request.getParameter("email");
            String nick = request.getParameter("nick");
            String pass = request.getParameter("pass");
            String rpass = request.getParameter("rpass");
            int age = Integer.parseInt(request.getParameter("age"));
            float weight = Float.parseFloat(request.getParameter("weight"));
            float height = Float.parseFloat(request.getParameter("height"));
            Statement instruccion = null;

            instruccion = con.getConnection().createStatement();

            try {
                instruccion.executeUpdate("INSERT INTO registro VALUES(NULL,'" + realname + "','" + nick + "','" + pass + "','" + age + "','" + gender + "','" + weight + "','" + height + "','" + email + "')");
                instruccion.close();
            } catch (SQLException e) {
                out.println(e);
            };
            out.println("Registro exitoso");
        %>
    </body>
</html>
